
Chapter 36. Finding Marvel Comic Covers

From the website:

  Killer Game Programming in Java
  http://fivedots.coe.psu.ac.th/~ad/jg

  Dr. Andrew Davison
  Dept. of Computer Engineering
  Prince of Songkla University
  Hat yai, Songkhla 90112, Thailand
  E-mail: ad@fivedots.coe.psu.ac.th


If you use this code, please mention my name, and include a link
to the website.

Thanks,
  Andrew

============================


Directory contents

There are 7 Java files:
 * GetID.java
      // Find the ID for a character name or series name.

 * FindComics.java
      // Use a character or series name/IDs with a date (range) to find comics.

 * LookupComicID.java
      // Use a comic ID to get details on a specific comic book.

 * WhichCharacters.java
       // Get a list of characters who appeared in a given series.
       // I don't use this tool in the chapter.

 * WhichSeries.java
       // Find series where a character name or ID has appeared.

 * GetName.java
      // Find the character or series name attached to the specified ID.
      // I don't use this tool in the chapter.


 * MarvelUtils.java
      // support library for all the tools



Two JAR files:
 * commons-codec-1.9.jar
       // downloaded from http://commons.apache.org/proper/commons-codec/

 * json-simple-1.1.1.jar
       // downloaded from https://code.google.com/p/json-simple/ 




There are 2 batch files:
 * compile.bat
 * run.bat
     - both batch files assume that commons-codec-1.9.jar and
       json-simple-1.1.1.jar are in the current directory



----------------------------
Compilation:

You must first register for a free Marvel developer account at
  http://developer.marvel.com/

and obtain a public and private API keys.

Then edit all the Java files (except MarvelUtils.java) to set the
constants PUBLIC_KEY and PRIVATE_KEY to be your keys.


 > compile *.java


----------------------------
Execution:

There are examples of how to use these tools in the comments of
each file, and in the chapter.

1. GetID    // Find the ID for a character name or series name
   Usage: run GetID [series] <name>
   e.g.
     > run GetID "luke cage"
     > run GetID series journey



2. FindComics    // Use a character or series name/IDs with a date (range) to find comics
   Usage: run FindComics (character|ID(s)|?) (series_title|ID(s)|?) [ year[-year] ]
                                       // ? means "doesn't matter"
   e.g.
     > run FindComics spider-man ? 1963
     > run FindComics ? 1987 1965
                     // 1987 == Amazing Spider-Man (1963 - 1998)



3. LookupComicsID    // Use a comic ID to get details on a specific comic book
   Usage: run LookupComicID <comic ID> [PNG image filename]
   e.g.
     > run LookupComicID 6649
     > run LookupComicID 6649  jj.png



4. WhichCharacters    // Get a list of characters who appeared in a given series.
   Usage: run WhichCharacters (<series title>|<series ID>)
   e.g.
     > run WhichCharacters journey
     > run WhichCharacters 2032



5. WhichSeries    // Find series where a character name or ID has appeared
   Usage: run WhichSeries (<character name>|<character ID>)
   e.g.
     > run WhichSeries juggernaut
     > run WhichSeries 1009382



6. GetName       // Find the character or series name attached to the specified ID
   Usage: run GetName [series] <ID>
   e.g.
     > run GetName 1009382
     > run GetName series 2021

---------
Last updated: 21st March 2014
